<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<s:head theme="ajax" />
		<base href="<%=basePath%>">
		<title>struts2标签</title>
	</head>
	<body>
		<center>
			<h2>
				struts2标签
			</h2>

			<!-- s:doubleselect级联菜单 -->
			<h3>s:doubleselect级联菜单</h3>
			<s:form name="test" action="test">
				<s:doubleselect tooltip="Choose Your State" label="State"
					name="region" list="{'中国', '美国'}" value="'china'"
					doubleValue="'American'"
					doubleList="top == '中国' ? {'北京', '上海'} : {'休斯顿', '纽约'}"
					doubleName="state" headerKey="-1"
					headerValue="---------- Please Select ----------"
					emptyOption="true" />
				<br>
				<br>
				<s:doubleselect label="doubleselect test1" name="menu"
					list="{'水果','蔬菜'}" doubleName="dishes"
					doubleList="top == '水果' ? {'苹果', '橘子'} : {'白菜', '西红柿'}" />
			</s:form>

			<!-- s:datetimepicker日期选择 -->
			<h3>s:datetimepicker日期选择</h3>
			<s:form name="test" action="#">
				<s:datetimepicker label="日期" name="date" displayFormat="yyyy-MM-dd"></s:datetimepicker>
				<br>
				<br>
				<s:datetimepicker name="date" label="日期" displayFormat="dddd年MM月dd日"
					weekStartsOn="2" />
			</s:form>

			<!-- s:tree树状选择图 -->
			<h3>s:tree树状选择图</h3>
			<a href="Tree.jsp">点击进入---查看静态树</a><br>
			<a href="DynamicTree.action">点击进入---查看模拟动态树</a><br>
			<a href="AjaxTree.action">点击进入---查看AjaxTree</a><br>
			<a href="AjaxTreeTheme.action">点击进入---查看自定义主题Tree</a>
			<s:form action="#">
				<s:tree label="计算机图书" id="book" theme="ajax" showRootGrid="true"
					showGrid="true" treeSelectedTopic="treeSelected">
					<s:treenode theme="ajax" label="施杨" id="shiyang">
						<s:treenode theme="ajax" label="Spring2.0宝典" id="spring" />
						<s:treenode theme="ajax" label="轻量级J2EE企业应用实战" id="lightweight" />
						<s:treenode theme="ajax" label="基于J2EE的Ajax宝典" id="ajax" />
					</s:treenode>
					<s:treenode theme="ajax" label="David" id="David">
						<s:treenode theme="ajax" label="JavaScript: The Definitive Guide"
							id="javascript" />
					</s:treenode>
					<s:treenode theme="ajax" label="Johnson" id="Johnson">
						<s:treenode theme="ajax"
							label="Expert One-on-One J2EE Design and Development" id="j2ee" />
					</s:treenode>
				</s:tree>
			</s:form>

			<!-- s:component自定义组件 -->
			<h3>s:component自定义组件</h3>
			<s:form name="form1" action="#">
				<s:component theme="customTheme" templateDir="customTemplateDir"
					template="ftlCustomTemplate">
					<s:param name="list"
						value="{'Spring2.0宝典' , '轻量级J2EE企业应用实战' , '基于J2EE的Ajax宝典'}" />
				</s:component>
			</s:form>

			<!-- s:updownselect排序标签 -->
			<h3>s:updownselect排序标签</h3>
			<s:form>
				<s:updownselect label="Favourite Countries"
					list="#{'england':'England','america':'America','germany':'Germany'}"
					name="prioritisedFavouriteCountries" headerKey="-1"
					headerValue="--- Please Order Them Accordingly ---"
					emptyOption="true" />
			</s:form>

			<!-- s:optiontransferselect可移动选项窗口 -->
			<h3>s:optiontransferselect可移动选项窗口</h3>
			<s:form>
				<s:optiontransferselect label="Favourite Cartoons Characters"
					name="leftSideCartoonCharacters" leftTitle="Left Title"
					rightTitle="Right Title" list="{'Popeye', 'He-Man', 'Spiderman'}"
					multiple="true" headerKey="headerKey"
					headerValue="--- Please Select ---" emptyOption="true"
					doubleList="{'Superman', 'Mickey Mouse', 'Donald Duck'}"
					doubleName="rightSideCartoonCharacters"
					doubleHeaderKey="doubleHeaderKey"
					doubleHeaderValue="--- Please Select ---" doubleEmptyOption="true"
					doubleMultiple="true" />
			</s:form>

			<!-- s:token令牌防止重复提交 -->
			<h3>s:token令牌防止重复提交</h3>
			<a href="token.jsp">点击进入</a>
			<s:form>
				<s:token />
			</s:form>

			<!-- s:radio单选框 -->
			<h3>s:radio单选框</h3>
			<s:form name="form1" action="#">
				<s:radio name="b" label="选择你喜欢的图书" labelposition="top"
					list="#{'1':'aaaaaa','2':'bbbbbb','3':'cccccc'}" listKey="Key"
					listValue="value" />
				<s:radio name="a" label="选择你喜欢的图书" labelposition="top"
					list="{'sdsdsd','sdsdsds','sdsdsdsd','sdsdsd'}" />
			</s:form>

			<!-- s:checkboxlist复选框 -->
			<h3>s:checkboxlist复选框</h3>
			<s:form>
				<s:checkboxlist tooltip="请选择" label="最爱的科目" list="{'英文','语文','数学'}"
					name="checklist" />

				<s:checkboxlist name="skills2" label="Skills 2"
					list="#{ 1:'Java', 2: '.Net', 3: 'RoR', 4: 'PHP' }" listKey="key"
					listValue="value" value="{ 1, 2}" />
			</s:form>

			<!-- s:select下拉菜单 -->
			<h3>s:select下拉菜单</h3>
			<s:form>
				<s:select name="news.uid" label="新闻分类"
					list="#{1:'生活新闻',2:'体育新闻',3:'学习新闻',4:'娱乐新闻'}" />
			</s:form>

			<!-- ajax dojo 在线编辑器 -->
			<h3>ajax dojo 在线编辑器</h3>
			<s:form>
				<s:textarea theme="ajax" name="content">
				</s:textarea>
			</s:form>

			<!-- s:checkbox单一复选框 -->
			<h3>s:checkbox单一复选框</h3>
			<s:form>
				<s:checkbox tooltip="请选择" label="check" name="check">
				</s:checkbox>
			</s:form>

			<!-- s:autocompleter自动完成 -->
			<h3>s:autocompleter自动完成</h3>
			<a href="Autocompleter.jsp">点击进入</a>
			
			<!-- Json -->
			<h3>Json</h3>
			<a href="JsonPlugin.html">点击进入</a>

			<!-- LinkButton -->
			<h3>LinkButton</h3>
			<a href="LinkButton.jsp">点击进入</a>
			
			<!-- Ajax DWR表单验证 -->
			<h3>Ajax DWR表单验证</h3>
			<a href="AjaxValidation!input.action">点击进入</a>
	</body>
</html>
